function HandlePAdminProject(gui, user, date, options, data) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._data = data;
  this._popupBox = new ModulePopupBox();

  this._createElements();
};

HandlePAdminProject.prototype._createElements = function() {
  var tr, td, _self = this;
  DOMUtils.removeTableRows(this._gui.mains, 1);
  
  if (this._data[0].data.length == 0) {
    tr = this._gui.mains.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 5;
    td.style.height = '24px';
    td.style.textAlign = 'left';
    td.style.paddingLeft = '5px';
    td.appendChild(document.createTextNode('n/a'));
  }

  MiscUtils.sort(this._data[0].data, ['prearrange_date']);
  for(var i = 0, il = this._data[0].data.length; i < il; i++) {
    var task = this._data[0].data[i];
    tr = this._gui.mains.insertRow(-1);
    tr.style.backgroundColor = (tr.rowIndex % 2 == 0) ? '#ececec' : '#fff';
    
    td = tr.insertCell(-1);
    td.style.borderRight = 'solid 1px #bbb';
    td.style.height = '24px';
    td.style.textAlign = 'left';
    td.style.padding = '0 5px';
    td.appendChild(document.createTextNode((task.branch) ? task.branch : '-'));
    
    td = tr.insertCell(-1);
    td.style.borderRight = 'solid 1px #bbb';
    td.style.height = '24px';
    td.style.textAlign = 'left';
    td.style.padding = '0 5px';
    td.appendChild(document.createTextNode((task.customer_id != 0) ? PPublishUtils.customerId(task.customer_id) : '-'));
    
    td = tr.insertCell(-1);
    td.style.padding = '0 5px';
    td.style.borderRight = 'solid 1px #bbb';
    td.appendChild(document.createTextNode(SimpleDate.format(SimpleDate.fromStamp(task.prearrange_date))));
    
    td = tr.insertCell(-1);
    td.style.padding = '0 5px';
    td.style.borderRight = 'solid 1px #bbb';
    td.appendChild(document.createTextNode(PPublishUtils.branch(task)));
    
    td = tr.insertCell(-1);
    td.style.padding = '0 5px';
    td.style.borderRight = 'solid 1px #bbb';
    var modify = document.createElement('img');
    modify.src = 'image/edit.png';
    modify.style.cursor = 'pointer';
    modify._task = task;
    modify.onclick = function() { var pos = DOMUtils.findPos(this);
                                  var div = document.createElement('div');
                                  var task = this._task;
                                  var notes = MiscUtils.find(_self._data['note'], [{ attrs: ['id'], value: task.id}])[0].notes;
                                  var func1 = function() { if (task.ub_akl == 0 && task.ub_mel == 0 && task.ub_syd == 0 && task.ub_nyc == 0 && task.ub_bne == 0 && task.ub_xtrao == 0) {
                                                             window.alert('至少选择一个用片公司');
                                                             return;
                                                           }
                                                           _self._popupBox._close();
                                                           var message = '发片计划时间: ' + SimpleDate.format(SimpleDate.fromStamp(task.prearrange_date)) + ', 用片公司: (' + PPublishUtils.branch(task) + ')';
                                                           var ns = [];
                                                           if (notes.length == 0) {
                                                             var note = pz_task_note.instance();
                                                             note.task_id = task.id;
                                                             note.note_user_id = _self._user.id;
                                                             note.note_date = _self._date;
                                                             note.note_content = message;
                                                             note.is_planning = 1;
                                                             ns[ns.length] = note;
                                                           } else {
                                                             for (var i = 0, il = notes.length; i < il; i++) {
                                                               var n = notes[i];
                                                               n.note_content = message;
                                                               n.note_user_id = _self._user.id;
                                                               n.note_date = _self._date;
                                                               ns[ns.length] = n;
                                                             }
                                                           }
                                                           new RequestUtils()._write2([{ n: 'pz_task', a: [task], r: [] }, { n: 'pz_task_note', a: ns, r: [] }], function() { location.reload(); }, { pos: pos });
                                                         };
                                  var func2 = function() { _self._popupBox._close();
                                                           location.reload();
                                                         };
                                  MiscUtils.dialog(_self._popupBox, pos, div, func1, func2, { t: '修改用片计划', width: 500, height: 50 });
                                  new ModuleDialogPlanning(document, div, null, null, _self._user, _self._date, { object: task});
                                };
    td.appendChild(modify);
  }
};
